<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BCategory
 *
 * @author I062261
 */
class BWCategory extends BWAttribute {

    public function __construct($owner = NULL, $context = NULL) {
        if ($owner instanceof BEntity) {
            $this->ownerId = $owner->getId();
            $this->ownerType = get_class($this);
        }
    }

    public function addMember($member, $member2 = NULL, $context = NULL) {
        if ($context == NULL) {
            $context = array();
            $context['memberModel'] = 'BWMCategoryMember';
            $context['memberCol'] = 'member_id';
            $context['myMemberCol'] = 'category_id';
        }
        return parent::addMember($member, $member2, $context);
    }

    public function getRepository($data = NULL, $reload = FALSE) {
        $repository = parent::getRepository($data, $reload);
        $repository->setModel('BWMCategory');
        return $repository;
    }
    
    public function getModelClass($data = NULL) {
        //parent::getModelClass($data);
        return 'BWMCategory';
    }

}

?>
